// const ffi = require("ffi-napi");
// const path = require("path");

// function useHelloWorld() {
//   const pathdir = path.resolve(__dirname, "dllmain.dll");
//   console.log("pathdir", pathdir);

//   // 加载 DLL 文件
//   const mydll = ffi.Library(pathdir, { HelloWorld: ["void", []] });

//   // 调用 DLL 中的函数
//   const data = mydll.HelloWorld();

//   console.log("data", data);
// }

// // useHelloWorld();

// exports.useHelloWorld = useHelloWorld;
const ffi = require("ffi-napi");
const path = require("path");

exports.useHelloWorld = function useHelloWorld() {
  // const dllPath = path.join(app.getAppPath(), "sdk", "dllmain.dll");
  // eslint-disable-next-line no-undef
  const dllPath = path.join(__static, "sdk", "dllmain.dll");
  console.log(dllPath);
  // const pathdir = path.resolve(__dirname, "dllmain.dll");
  // console.log("pathdir", pathdir);
  // 加载 DLL 文件
  const mydll = ffi.Library(dllPath, { HelloWorld: ["void", []] });

  // 调用 DLL 中的函数
  const data = mydll.HelloWorld();

  console.log("data", data);
};
